package com.tf.temper.entity;

/**
 * 
 *
 * @date 2020-09-15 09:52:39
 */
public class DeviceReturnEntity<Entity>
{
	private Entity ret;
	private String desc;
	private long  timestamp;


	public DeviceReturnEntity()
	{
		this.desc = "Success";
		this.timestamp = System.currentTimeMillis()/1000;
	}

	public DeviceReturnEntity(Entity ret,String desc,long timestamp) {
		this.ret = ret;
		this.desc = desc;
		this.timestamp = timestamp;
	}

	public DeviceReturnEntity(Entity entity) {
		this();
		this.ret = entity;
	}

	public DeviceReturnEntity<Entity> ok(Entity entity) {
		this.ret = entity;
		return this;
	}

	public DeviceReturnEntity<Entity> ok() {
		return this;
	}

	public DeviceReturnEntity<Entity> error(String desc) {
		return new DeviceReturnEntity("500", desc,System.currentTimeMillis()/1000);
	}

	public DeviceReturnEntity<Entity> errorLogic(String desc) {
		return new DeviceReturnEntity("1", desc,System.currentTimeMillis()/1000);
	}

	public DeviceReturnEntity<Entity> put(Entity entity) {
		this.ret = entity;
		return this;
	}

	public Entity getRet() {
		return this.ret;
	}

	public String getDesc() {
		return this.desc;
	}

	public void setRet(Entity ret) {
		this.ret = ret;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public long getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(long timestamp) {
		this.timestamp = timestamp;
	}
}
